<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link href="cpip.css" rel="stylesheet" type="text/css" />
    <title>File: /Users/paulross/dev/linux/linux-3.13/include/linux/threads.h</title>
  </head>
  <body>
    <h1>File: /Users/paulross/dev/linux/linux-3.13/include/linux/threads.h</h1>
    <p>Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.</p>
    <pre><a name="1" /><span class="Maybe">       1:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_X0xJTlVYX1RIUkVBRFNfSF8w"><span class="b">_LINUX_THREADS_H</span></a>
<a name="2" /><span class="Maybe">       2:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_X0xJTlVYX1RIUkVBRFNfSF8w"><span class="b">_LINUX_THREADS_H</span></a>
<a name="3" /><span class="Maybe">       3:</span> 
<a name="4" /><span class="Maybe">       4:</span> 
<a name="5" /><span class="Maybe">       5:</span> <span class="k">/*</span>
<a name="6" /><span class="Maybe">       6:</span> <span class="k"> * The default limit for the nr of threads is now in</span>
<a name="7" /><span class="Maybe">       7:</span> <span class="k"> * /proc/sys/kernel/threads-max.</span>
<a name="8" /><span class="Maybe">       8:</span> <span class="k"> */</span>
<a name="9" /><span class="Maybe">       9:</span> 
<a name="10" /><span class="Maybe">      10:</span> <span class="k">/*</span>
<a name="11" /><span class="Maybe">      11:</span> <span class="k"> * Maximum supported processors.  Setting this smaller saves quite a</span>
<a name="12" /><span class="Maybe">      12:</span> <span class="k"> * bit of memory.  Use nr_cpu_ids instead of this except for static bitmaps.</span>
<a name="13" /><span class="Maybe">      13:</span> <span class="k"> */</span>
<a name="14" /><span class="False">      14:</span> <span class="f">#</span><span class="n">ifndef</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05SX0NQVVNfMA__"><span class="b">CONFIG_NR_CPUS</span></a>
<a name="15" /><span class="False">      15:</span> <span class="k">/* FIXME: This should be fixed in the arch&apos;s Kconfig */</span>
<a name="16" /><span class="False">      16:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_Q09ORklHX05SX0NQVVNfMA__"><span class="b">CONFIG_NR_CPUS</span></a>    <span class="c">1</span>
<a name="17" /><span class="Maybe">      17:</span> <span class="f">#</span><span class="n">endif</span>
<a name="18" /><span class="Maybe">      18:</span> 
<a name="19" /><span class="Maybe">      19:</span> <span class="k">/* Places which use this should consider cpumask_var_t. */</span>
<a name="20" /><span class="Maybe">      20:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_ref.html#_TlJfQ1BVU18w"><span class="b">NR_CPUS</span></a>        <a href="cpu.c_macros_ref.html#_Q09ORklHX05SX0NQVVNfMA__"><span class="b">CONFIG_NR_CPUS</span></a>
<a name="21" /><span class="Maybe">      21:</span> 
<a name="22" /><span class="Maybe">      22:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_TUlOX1RIUkVBRFNfTEVGVF9GT1JfUk9PVF8w"><span class="b">MIN_THREADS_LEFT_FOR_ROOT</span></a> <span class="c">4</span>
<a name="23" /><span class="Maybe">      23:</span> 
<a name="24" /><span class="Maybe">      24:</span> <span class="k">/*</span>
<a name="25" /><span class="Maybe">      25:</span> <span class="k"> * This controls the default maximum pid allocated to a process</span>
<a name="26" /><span class="Maybe">      26:</span> <span class="k"> */</span>
<a name="27" /><span class="Maybe">      27:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_UElEX01BWF9ERUZBVUxUXzA_"><span class="b">PID_MAX_DEFAULT</span></a> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX0JBU0VfU01BTExfMA__"><span class="b">CONFIG_BASE_SMALL</span></a> <span class="f">?</span> <span class="c">0x1000</span> <span class="f">:</span> <span class="c">0x8000</span><span class="f">)</span>
<a name="28" /><span class="Maybe">      28:</span> 
<a name="29" /><span class="Maybe">      29:</span> <span class="k">/*</span>
<a name="30" /><span class="Maybe">      30:</span> <span class="k"> * A maximum of 4 million PIDs should be enough for a while.</span>
<a name="31" /><span class="Maybe">      31:</span> <span class="k"> * [NOTE: PID/TIDs are limited to 2^29 ~= 500+ million, see futex.h.]</span>
<a name="32" /><span class="Maybe">      32:</span> <span class="k"> */</span>
<a name="33" /><span class="Maybe">      33:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_UElEX01BWF9MSU1JVF8w"><span class="b">PID_MAX_LIMIT</span></a> <span class="f">(</span><a href="cpu.c_macros_ref.html#_Q09ORklHX0JBU0VfU01BTExfMA__"><span class="b">CONFIG_BASE_SMALL</span></a> <span class="f">?</span> <a href="cpu.c_macros_ref.html#_UEFHRV9TSVpFXzA_"><span class="b">PAGE_SIZE</span></a> <span class="f">*</span> <span class="c">8</span> <span class="f">:</span> \
<a name="34" /><span class="Maybe">      34:</span>     <span class="f">(</span><span class="m">sizeof</span><span class="f">(</span><span class="m">long</span><span class="f">)</span> <span class="f">&gt;</span> <span class="c">4</span> <span class="f">?</span> <span class="c">4</span> <span class="f">*</span> <span class="c">1024</span> <span class="f">*</span> <span class="c">1024</span> <span class="f">:</span> <a href="cpu.c_macros_noref.html#_UElEX01BWF9ERUZBVUxUXzA_"><span class="b">PID_MAX_DEFAULT</span></a><span class="f">)</span><span class="f">)</span>
<a name="35" /><span class="Maybe">      35:</span> 
<a name="36" /><span class="Maybe">      36:</span> <span class="k">/*</span>
<a name="37" /><span class="Maybe">      37:</span> <span class="k"> * Define a minimum number of pids per cpu.  Heuristically based</span>
<a name="38" /><span class="Maybe">      38:</span> <span class="k"> * on original pid max of 32k for 32 cpus.  Also, increase the</span>
<a name="39" /><span class="Maybe">      39:</span> <span class="k"> * minimum settable value for pid_max on the running system based</span>
<a name="40" /><span class="Maybe">      40:</span> <span class="k"> * on similar defaults.  See kernel/pid.c:pidmap_init() for details.</span>
<a name="41" /><span class="Maybe">      41:</span> <span class="k"> */</span>
<a name="42" /><span class="Maybe">      42:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_UElEU19QRVJfQ1BVX0RFRkFVTFRfMA__"><span class="b">PIDS_PER_CPU_DEFAULT</span></a>    <span class="c">1024</span>
<a name="43" /><span class="Maybe">      43:</span> <span class="f">#</span><span class="n">define</span> <a href="cpu.c_macros_noref.html#_UElEU19QRVJfQ1BVX01JTl8w"><span class="b">PIDS_PER_CPU_MIN</span></a>    <span class="c">8</span>
<a name="44" /><span class="Maybe">      44:</span> 
<a name="45" /><span class="True">      45:</span> <span class="f">#</span><span class="n">endif</span>
<a name="46" /><span class="True">      46:</span> </pre>
  </body>
</html>
